package cn.iocoder.yudao.module.erp.dal.mysql.business.money.moneyincome;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.controller.admin.business.money.moneyincome.vo.MoneyIncomePageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.business.money.moneyincome.MoneyIncomeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 收入类型 Mapper
 *
 * @author yy
 */
@Mapper
public interface MoneyIncomeMapper extends BaseMapperX<MoneyIncomeDO> {

    default PageResult<MoneyIncomeDO> selectPage(MoneyIncomePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MoneyIncomeDO>()
                .likeIfPresent(MoneyIncomeDO::getName, reqVO.getName())
                .betweenIfPresent(MoneyIncomeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MoneyIncomeDO::getId));
    }

}